package com.edu.demo.mapper;

import com.edu.demo.entity.Teacher;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author jixuewei
 * @since 2023-01-12
 */
@Mapper
public interface TeacherMapper extends BaseMapper<Teacher> {

    @Select("select * from teacher where code = #{code}")
    Teacher selectByCode(String code);

    List<Teacher> findTeachers(Teacher teacher, @Param("index") int index,@Param("size") int size);

    @Select("select count(*) from teacher")
    int count();
}
